Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@types/koa-send

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/koa-send

TypeScript definitions for koa-send

  • 4.1.6
  • ts4.5
  • ts4.6
  • ts4.7
  • ts4.8
  • ts4.9
  • ts5.0
  • ts5.1
  • ts5.2
  • ts5.3
  • ts5.4
  • ts5.5
  • ts5.6
  • ts5.7
  • ts5.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
137K
increased by22.51%
Maintainers
1
Weekly downloads
 
Created
Source

Installation

npm install --save @types/koa-send

Summary

This package contains type definitions for koa-send (https://github.com/koajs/send).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/koa-send.

index.d.ts

import { ParameterizedContext } from "koa";

import { Stats } from "fs";

declare function send(ctx: ParameterizedContext, path: string, opts?: send.SendOptions): Promise<string>;

declare namespace send {
    type SetHeaders = (res: ParameterizedContext["res"], path: string, stats: Stats) => any;

    interface SendOptions {
        /** Browser cache max-age in milliseconds. (defaults to 0) */
        maxage?: number | undefined;
        maxAge?: SendOptions["maxage"] | undefined;
        /** Tell the browser the resource is immutable and can be cached indefinitely. (defaults to false) */
        immutable?: boolean | undefined;
        /** Allow transfer of hidden files. (defaults to false) */
        hidden?: boolean | undefined;
        /** Root directory to restrict file access. (defaults to '') */
        root?: string | undefined;
        /** Name of the index file to serve automatically when visiting the root location. (defaults to none) */
        index?: string | false | undefined;
        /** Try to serve the gzipped version of a file automatically when gzip is supported by a client and if the requested file with .gz extension exists. (defaults to true). */
        gzip?: boolean | undefined;
        /** Try to serve the brotli version of a file automatically when brotli is supported by a client and if the requested file with .br extension exists. (defaults to true). */
        brotli?: boolean | undefined;
        /** If not false (defaults to true), format the path to serve static file servers and not require a trailing slash for directories, so that you can do both /directory and /directory/. */
        format?: boolean | undefined;
        /** Function to set custom headers on response. */
        setHeaders?: SetHeaders | undefined;
        /** Try to match extensions from passed array to search for file when no extension is sufficed in URL. First found is served. (defaults to false) */
        extensions?: string[] | false | undefined;
    }
}

export = send;

Additional Details

  • Last updated: Tue, 07 Nov 2023 09:09:38 GMT
  • Dependencies: @types/koa

Credits

These definitions were written by Peter Safranek, and Tomek Łaziuk.

FAQs

Package last updated on 07 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc